//
//  MeMyPostListController.m
//  youthNote
//
//  Created by huangrensheng on 16/7/18.
//  Copyright © 2016年 laber. All rights reserved.
//  我的帖子列表页

#import "MeMyPostListController.h"
#import "MeMyPostListCell.h"
#import "MeSendPostController.h"

@interface MeMyPostListController()
@property (nonatomic, strong) UITableView *myPostTable;
@end

@implementation MeMyPostListController

- (void)viewDidLoad{
    [super viewDidLoad];
    [self createWithLeftStyle:@{@"type":@"back"} middleStyle:@{@"type":@"title",@"title":@"我的帖子"} rightStyle:@{@"type":@"btn",@"title":@"发帖"}];
    
    self.myPostTable = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
    self.myPostTable.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.myPostTable.delegate = self;
    self.myPostTable.dataSource = self;
    [self.view addSubview:self.myPostTable];
    [self.myPostTable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 10;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 64;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *identifer = @"MeMyPostListCell";
    MeMyPostListCell *cell = [tableView dequeueReusableCellWithIdentifier:identifer];
    if(!cell){
        cell = [[MeMyPostListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifer];
    }
    return cell;
}

- (void)rightNactionItemClick:(UIButton *)btn{
    MeSendPostController *sendPost = [[MeSendPostController alloc] init];
    [self.navigationController pushViewController:sendPost animated:YES];
//    [self presentViewController:sendPost animated:YES completion:nil];
}
@end
